<?php
if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}

$fids = '0,9999,99999'; //不想显示内容到首页的版块，多个版块请用半角逗号分开

$perpage = 8; //每页显示数量

$page = empty($_GET['page'])?1:intval($_GET['page']);
$start = ($page-1)*$perpage;

$count = DB::result(DB::query("SELECT COUNT(*) FROM ".DB::table('forum_thread')." WHERE fid not in ($fids) AND displayorder > -1 AND special=0 AND isgroup = 0"));
$thread_list = array();
if ($count) {
     $threadlist = DB::query("SELECT * FROM ".DB::table('forum_thread')." WHERE fid not in ($fids) AND displayorder > -1 AND special=0 AND isgroup = 0 ORDER BY dateline DESC LIMIT $start,$perpage");
      while ($get = DB::fetch($threadlist)) {
		$thread_list[]=$get;
    }
}


$guidethread_list = array();
$guidethreadlist = DB::query("SELECT * FROM ".DB::table('forum_thread')." WHERE displayorder > -1 AND special=0 AND attachment = 2 AND isgroup = 0 AND digest > 0 ORDER BY dateline DESC LIMIT 0,6");
      while ($get = DB::fetch($guidethreadlist)) {
		$guidethread_list[]=$get;
    }


$hot_thread_list = array();
$hot_threadlist = DB::query("SELECT * FROM ".DB::table('forum_thread')." WHERE displayorder > -1 AND special=0 AND isgroup = 0 ORDER BY lastpost DESC LIMIT 0,8");
      while ($get = DB::fetch($hot_threadlist)) {
		$hot_thread_list[]=$get;
    }


$multi = multi($count, $perpage, $page, "portal.php?item-list");

?>
